<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>JQuery循环读取数据</title>
    <script src="JS/jquery-3.3.1.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function() {
            //数组
            var arr = ["HTML", "CSS", "JavaScript", "JQuery", "BootStrap", "Angular", "Node.js"];
            //2、jQuery的each
            $.each(arr, function(a, b){
                $("#Result").append("<li>索引：" + a + "    数据：" + b + "</li>");
            });

            //JSON
            var obj ={a:123, id:201805001, remark:"测试JSON读取"};
            $("#Result").append("<li>读取JSON数据</li>");
            $.each(obj, function(name, value){
                $("#Result").append("<li>键名：" + name + "    对应的值：" + value + "</li>");
            });
        });
    </script>

</head>
<body>
    <div id="Result"></div>    
</body>
</html>